import 'dart:math';

import 'package:built_collection/built_collection.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';
import 'package:mobile_app.core/core/domain/config/config.dart';
import 'package:mobile_app.core/core/domain/entities/dialect.dart';
import 'package:mobile_app.core/core/presentation/helpers/screen_util_mixin.dart';
import 'package:mobile_app.core/core/presentation/helpers/show_dialogs.dart';
import 'package:mobile_app.core/core/presentation/theme/theme.dart';
import 'package:mobile_app.core/core/presentation/utils/icons/custom_semibold_icons.dart';
import 'package:mobile_app.core/core/presentation/widget_config.dart';
import 'package:mobile_app.core/core/presentation/widgets/animated_segmented_progress_bar.dart';
import 'package:mobile_app.core/core/presentation/widgets/app_back_button.dart';
import 'package:mobile_app.core/core/presentation/widgets/app_icon_button.dart';
import 'package:mobile_app.core/core/presentation/widgets/dialogs/app_action_dialog.dart';
import 'package:mobile_app.core/core/presentation/widgets/fade_built_transition.dart';
import 'package:mobile_app.core/core/presentation/widgets/navigation_bar_title.dart';
import 'package:mobile_app.core/core/presentation/widgets/scale_built_transition.dart';
import 'package:mobile_app.core/core/presentation/widgets/segmented_progress_bar.dart';
import 'package:mobile_app.core/core/presentation/widgets/slide_built_transition.dart';
import 'package:mobile_app.core/core/presentation/widgets/stateful_wloc.dart';
import 'package:mobile_app.core/core/presentation/widgets/wloc_builder.dart';
import 'package:mobile_app.core/injection_container.dart' as core_di;
import 'package:mobile_app.core/root_navigator/application/models/spaced_repetition_page_model.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/addition_to_collection_card_action.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/card_action.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/editing_card_action.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/exclusion_from_learning_card_action.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/mark_as_completely_learned_card_action.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/mistake_report_card_action.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/progress_reset_card_action.dart';
import 'package:mobile_app.home.core/core/presentation/helpers/card_wloc_mixin.dart';
import 'package:mobile_app.home.core/core/presentation/localization/translation.dart';
import 'package:mobile_app.home.core/core/presentation/theme/home_core_theme.dart';
import 'package:mobile_app.home.core/core/presentation/widgets/lexical_item_card.dart';
import 'package:mobile_app.home.core/custom_lexical_item_editing_page/presentation/page/page.dart';
import 'package:mobile_app.home.learning.core/core/presentation/theme/theme.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/daily_limit_card/presentation/card/card.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/learning_finish_card/presentation/card/card.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/memorization_card/presentation/card/card.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/repetition_answer_selection_exposed_card/presentation/card/card.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/repetition_answer_selection_obscure_card/presentation/card/card.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/repetition_answer_typing_card/presentation/card/card.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/spaced_repetition_page/application/bloc/bloc.dart'
    as bloc;
import 'package:mobile_app.home.learning.spaced_repetitions/spaced_repetition_page/domain/entities/card_actions/skip_card_action.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/spaced_repetition_page/domain/entities/card_infos/card_info.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/spaced_repetition_page/injection_container.dart'
    as spaced_repetition_page_di;
import 'package:mobile_app.home.learning.spaced_repetitions/spaced_repetition_page/presentation/localization/translation.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/unspecified_lexical_item_exposed_card/presentation/card/card.dart';
import 'package:mobile_app.home.learning.spaced_repetitions/unspecified_lexical_item_obscure_card/presentation/card/card.dart';

part 'view.dart';

part 'widgets/clockwise_slide_built_transition.dart';

part 'widgets/counterclockwise_slide_built_transition.dart';

part 'wloc.dart';

part 'wloc_state.dart';

class SpacedRepetitionPage extends StatefulWidget {
  const SpacedRepetitionPage({
    required this.pageModel,
    super.key,
  });

  final SpacedRepetitionPageModel pageModel;

  @override
  State<SpacedRepetitionPage> createState() => _SpacedRepetitionPageWloc();
}
